﻿using System;
using System.Collections.Generic;
using System.Text;

using Vitruvian.Serialization;

namespace SpotItServerAPI
{
    [OptimisticSerialization]
    public class OperationResult
    {
        private string errorMessage;

        public OperationResult()
        {
            ErrorMessage = "";
        }

        public OperationResult(string message)
        {
            ErrorMessage = message;
        }

        public bool Success
        {
            get { return string.IsNullOrEmpty(errorMessage); }
        }

        public string ErrorMessage
        {
            get { return errorMessage; }
            set
            {
                errorMessage = value;
                if (errorMessage == null)
                    errorMessage = "";
            }
        }

        public object Data { get; set; }
    }

}
